#coding:utf8
from django.http import HttpResponse
from review.mysqlhandler import dbh

def index(req):
	str_js = '<link rel="stylesheet" type="text/css" href="/static/css/style.css" />'
	str_begin = '''
		<div id="div_data">
			<table width="auto" class="table">
	'''
	str_html = '''
		<tr class="class_tr">
			<td>%s</td>
			<td>%s</td>
			<td>%s</td>
		</tr>
	'''
	str_end = '''
			</table>
		</div>
	'''
	ls = dbh.ExecQuery("SELECT * FROM T_CP;")
	sblx = ''
	for l in ls:
		sblx += str_html % (l[0],l[1],l[2])
	return HttpResponse(str_js + str_begin + sblx + str_end)